home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Presentation Partner
/
Presentation Partner.iso
/
sstv1
/
runtime
/
sstbase.mst
< prev
Wrap
Text File
|
1994-03-02
|
10KB
|
321 lines
''**************************************************************************
''* SST Setup Script...
''**************************************************************************
''*** DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
DECLARE FUNCTION InstallCarousel LIB "MSCUISTF.dll" ( DestDir$ ) AS INTEGER
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST EXITRUNTIME = 750
CONST OPTIONS = 800
CONST APPHELP = 900
CONST BADPATH = 6400
'' @Update Me Total Size Requirements
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
GLOBAL OPTCUR$ ''Option selection from option dialog.
GLOBAL FreeSpace&
GLOBAL WinDir$ '' Stores Windows Directory
DECLARE SUB Install
DECLARE SUB UpdateINIfiles
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "SST Setup"
Temp$ = "SST Runtime Version 1.1" + CHR$(13) + "Copyright (C) 1993-94, Ask Me Multimedia, Inc."
SetAbout "Super Show & Tell", TEMP$
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SSTINF.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
'' DEST$ = "C:\SSTV1"
@Update Me Default Destination
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
ISWINDOWS31:
' Check Windows Version...
MajorVer% = GetWindowsMajorVersion()
MinorVer% = GetWindowsMinorVersion()
IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
i% = DoMsgBox("SST requires Microsoft Windows version 3.10 or greater. Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
DESTDRIVE$ = MID$(DEST$, 1, 1)
FreeSpace& = GetFreeSpaceForDrive(DEST$)
IF FreeSpace& < SpaceNeeded& THEN
GOSUB MORESPACE
GOTO GETPATHL1
ENDIF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO WELCOME
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
WinDir$ = GetWindowsDir()
Install
CursorState% = ShowWaitCursor()
ErrorCode% = InstallCarousel (Dest$) ' Our Function to re-join split files and decompress if needed
UpdateINIfiles
RestoreCUrsor CursorState%
IF ErrorCode% THEN
ELSE
GOTO QUIT
END IF
AutoDesk$ = GetIniKeyString( "WIN.INI", "AAPLAY Animation", "FullScreen" )
IF AutoDesk$ = "" THEN
CopyFile DEST$ + "\AAPLAY.DLL", WinDir$ + "SYSTEM\AAPLAY.DLL", cmoBackup, 0
WriteToLogFile "AAPLAY Animation not found in WIN.INI, copying AAPLAY.DLL"
ELSE
WriteToLogFile "Found AAPLAY Animation in WIN.INI - Checking for AAVGA.DLL and AAPLAY.DLL"
AAVGA$ = FindFileInTree("AAVGA.DLL", WinDir$)
WriteToLogFile "Search result for AAVGA.dll is |" + AAVGA$ + "|"
AAPLAY$ = FindFileInTree("AAPLAY.DLL", WinDir$)
WriteToLogFile "Search result for AAPLAY.dll is |" + AAPLAY$ + "|"
IF AAPLAY$ = "" THEN
' Remove Section from INI file when AAPLAY.DLL not found.
i% = FRemoveIniSection ( "WIN.INI", "AAPLAY Animation", cmoForce)
CopyFile DEST$ + "\AAPLAY.DLL", WinDir$ + "SYSTEM\AAPLAY.DLL", cmoBackup, 0
WriteToLogFile "Copied AAPLAY.DLL to WINDOWS\SYSTEM Directory"
ELSE
WriteToLogFile "Will not copy AAPLAY.DLL, found another version."
ENDIF
ENDIF
RemoveFile DEST$ + "\AAPLAY.DLL", cmoForce
GET_VFW_VERSION:
WriteToLogFile "Checking Version of Video for Windows"
MCIDriver$ = GetIniKeyString( "SYSTEM.INI", "MCI", "AVIVideo" )
IF MCIDriver$ = "" THEN
WriteToLogFile "Could not find Video For Windows ([MCI] in System.ini)"
GOSUB ALERTNEEDVFW
ELSE
LookFor$ = WinDir$ + "System\" + MCIDriver$
WriteToLogFile "Checking Version of " + LookFor$
AVIVersion$ = GetVersionOfFile( LookFor$ )
WriteToLogFile "Version Found is " + AVIVersion$
LookFor$ = ""
' AVIMajor& = GetVersionNthField( AVIVersion$, 1)
AVIMinor& = GetVersionNthField( AVIVersion$, 2)
IF AVIMinor& < 10 THEN
GOSUB ALERTNEEDVFW
ELSE
WriteToLogFile "Found good VFW, Version is: " + AVIVersion$
ENDIF
ENDIF
CloseLogFile
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITRUNTIME
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted, call (612) 531-0603!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
MORESPACE:
Temp$ = "SST needs " + STR$(SpaceNeeded&) + " bytes to install." + CHR$(13)
Temp$ = Temp$ + "There is only " + STR$(FreeSpace&) +" bytes free."
i% = DoMsgBox( Temp$, "Not Enough Disk Space", MB_OK+MB_TASKMODAL+MB_ICONHAND)
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
ALERTNEEDVFW:
' Need to Install VFW 1.1 Runtime
Msg$ = "IMPORTANT!" + CHR$(13) + CHR$(13)
Msg$ = Msg$ + "Don't forget to install the Video for Windows Runtime Version 1.1" + CHR$(13) + CHR$(13)
Msg$ = Msg$ + "This will insure that your Movies will play properly."
i% = DoMsgBox( Msg$, "Attention Installer!", MB_OK+MB_TASKMODAL+MB_ICONHAND)
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
WriteToLogFile ""
WriteToLogFile " User chose as destination directory: '" + DEST$ + "'"
WriteToLogFile " User chose option: '" + OPTCUR$ + "'"
WriteToLogFile ""
AddSectionFilesToCopyList "Files", SrcDir$, DEST$
CopyFilesInCopyList
END SUB
SUB UpdateINIfiles STATIC
'' Update SST's INI file with installed paths.
INIFile$ = DEST$ + "\SST.INI"
CreateIniKeyValue INIFile$, "SST", "picturedir", DEST$, cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "picturetype", "1", cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "sounddir", DEST$, cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "soundtype", "1", cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "carouseldir", DEST$, cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "userselectdir", DEST$, cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "altered", "0", cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "moviedir", DEST$, cmoOverwrite
CreateIniKeyValue INIFile$, "SST", "movietype", "2", cmoOverwrite
' Disable MIDI warning message...
SYSIni$ = WinDir$ + "SYSTEM.INI"
CopyFile SYSIni$, WinDir$ + "SYSTEM.ASK", cmoOverwrite, 0
CreateIniKeyValue SysIni$, "mciseq.drv", "disablewarning", "true", cmoOverwrite
'' Add File Manager associations to WIN.INI file for Carousels.
' CopyFile WinDir$ + "WIN.INI", "WIN.ASK", cmoOverwrite, 0
' INIFile$ = WinDir$ + "WIN.INI"
' CreateIniKeyValue INIFile$, "Extensions", "sst", DEST$ + "\SST.EXE ^.sst", cmoOverwrite
' CreateIniKeyValue INIFile$, "Extensions", "car", DEST$ + "\SST.EXE ^.car", cmoOverwrite
@Update Me Program Group
@Update Me Show Group
UseIcon1$ = " , 1, 1, 1," + DEST$
UseIcon2$ = " , 0, 1, 1," + DEST$
@Update Me Program Item
@Update Me Runtime Item
'' CloseLogFile
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION